const fs = require('fs').promises
fs.readFile('./file',(err,data)=>{
    if(err) throw err;
    console.log(data.toString())
})
//promise api async/await
(async ()=>{
    const fs = require('fs')
    const {promisify} = require('util')
    const readFile = promisify(fs.readFile)
    const data = await readFile('./file')
    console.log(data.toString())
})